<?php $post = $this->get("post");?>
<div class="nc">
<h2 class="n-title"><?php _e($post['title'])?></h2>
<div style="padding:5px 0px 20px 0px">
	<?php if($post['created_by_photo']):?>
	<img style="margin-right:3px;float:left;border:1px solid #ccc;padding:1px;width:50px;height:50px" src="<?php _baseUrl()?>/files/photo/<?php _e($post['created_by_photo'])?>"/>
	<?php else:?>
	<img style="margin-right:3px;float:left;border:1px solid #ccc;padding:1px;width:50px;height:50px" src="<?php _baseUrl()?>/files/photo/noavatar.gif"/>
	<?php endif;?>	
	Người viết: <?php _e(get_user_link($post['created_by_id'],$post['created_by_name'],$post['created_is_deleted']) ) ?><br/>
	Lúc: <label class="n-t"><?php _e(date('H:i A',strtotime($post['date'])))?></label> | <label class="n-d"><?php _e(date('d/m/Y',strtotime($post['date'])))?></label>
	<br/>Chuyên mục: <a href="#News/Index/Cat?ID=<?php _e($post['parent_id']);?>"><?php _e($post['cat_title']);?></a>
	<div class="clear"></div>
</div>
<div class="n-content">
	<?php _e(content_format($post['content']))?>
</div>

<div style="padding:10px 0px;font-weight:bold;background:url(<?php _e(BASE_URL)?>/style/images/comments.png) no-repeat left center;padding-left:27px">
<table width="100%">
<tr><td>
<?php if( count( $this->get("comments") )  == 0 ):?>
Chưa có thảo luận nào
<?php else:?>
Có <?php _e( count( $this->get("comments") ));?> thảo luận:
<?php endif;?>
</td>
<td width="20%" align='right'>
<a class="x-button" onclick="load_inframe('<?php _baseUrl($this)?>/News/Comment/Add?news_id=<?php _e($post['ID']);?>',{title:'Thảo luận', auto_hidden: true})">Thảo Luận</a>
</td>
</tr></table>
</div>
<?php if( count( $this->get("comments") )  > 0 ):?>
<div style="overflow:auto;margin-top:5px;border:1px solid #ddd;padding:2px">
	<table cellpadding="5" border="1" bordercolor="#dddddd" width="100%">
	<!--START COMMENT-->
	<?php foreach( $this->get("comments") as $k => $a ): ?>
	<tr>
		<!--<td class="x-info-comment" valign="top" align="center">
			<?php if($a['created_by_photo']):?>
			<img class="comment-avatar" src="<?php _baseUrl()?>/files/photo/<?php _e($a['created_by_photo'])?>"/>
			<?php else:?>
			<img class="comment-avatar" src="<?php _baseUrl()?>/files/photo/noavatar.gif"/>
			<?php endif;?>
		</td>-->
		<td valign="top" align="left">
			<div class="comment-bar">
				<span class="comment-copy">Đăng bởi <?php _e(get_user_link($a['created_by_id'],$a['created_by_name'],$a['created_is_deleted']) )?> 
					lúc <?php _e(show_date(TIME_FORMAT,$a['date_created']))?> <?php _e(show_date(DATE_FORMAT,$a['date_created']))?>
					<?php if( $a['date_updated'] != $a['date_created'] ):?>
					<span class="date-edit">( sửa lúc: <?php _e(show_date(TIME_FORMAT,$a['date_created']))?>  <?php _e(show_date(DATE_FORMAT,$a['date_created']))?> )</span>
					<?php endif;?></span>
				<span class="comment-button-news">
					<a onclick="load_inframe('<?php _baseUrl($this)?>/News/Comment/Add?comment_id=<?php _e($a['ID']);?>&news_id=<?php _e($post['ID']);?>',{title:'Thảo luận', auto_hidden: true});">Trích dẫn</a>
					<?php if( $a['created_by_id'] == get_user_id() ):?>
					 | <a onclick="module_delete('<?php _baseUrl($this)?>/News/Comment/Delete?ID=<?php _e($a['ID']);?>')">Xóa</a> | 
					<a onclick="load_inframe('<?php _baseUrl($this)?>/News/Comment/Edit?ID=<?php _e($a['ID']);?>',{title:'Sửa thảo luận', auto_hidden: true});">Sửa</a>
					<?php endif;?>
				</span>				
			</div>	
			<div class="comment-content">
				<?php _e(content_format($a['content']));?>
			</div>
		</td>
	</tr><?php endforeach;?>
	<!--END COMMENT-->
	</table>
</div>
<?php endif;?>
</div>